3.4.67 \(\int \frac {(f+g x^n)^2 \log (c (d+e x^n)^p)}{x} \, dx\) [367]

Optimal. Leaf size=176 \[ -\frac {2 f g p x^n}{n}+\frac {d g^2 p x^n}{2 e n}-\frac {g^2 p x^{2 n}}{4 n}-\frac {d^2 g^2 p \log \left (d+e x^n\right )}{2 e^2 n}+\frac {g^2 x^{2 n} \log \left (c \left (d+e x^n\right )^p\right )}{2 n}+\frac {2 f g \left (d+e x^n\right ) \log \left (c \left (d+e x^n\right )^p\right )}{e n}+\frac {f^2 \log \left (-\frac {e x^n}{d}\right ) \log \left (c \left (d+e x^n\right )^p\right )}{n}+\frac {f^2 p \text {Li}_2\left (1+\frac {e x^n}{d}\right )}{n} \]

[Out]

-2*f*g*p*x^n/n+1/2*d*g^2*p*x^n/e/n-1/4*g^2*p*x^(2*n)/n-1/2*d^2*g^2*p*ln(d+e*x^n)/e^2/n+1/2*g^2*x^(2*n)*ln(c*(d
+e*x^n)^p)/n+2*f*g*(d+e*x^n)*ln(c*(d+e*x^n)^p)/e/n+f^2*ln(-e*x^n/d)*ln(c*(d+e*x^n)^p)/n+f^2*p*polylog(2,1+e*x^
n/d)/n

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 176, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {2525, 45, 2463, 2436, 2332, 2441, 2352, 2442} \begin {gather*} \frac {f^2 p \text {PolyLog}\left (2,\frac {e x^n}{d}+1\right )}{n}+\frac {f^2 \log \left (-\frac {e x^n}{d}\right ) \log \left (c \left (d+e x^n\right )^p\right )}{n}+\frac {2 f g \left (d+e x^n\right ) \log \left (c \left (d+e x^n\right )^p\right )}{e n}+\frac {g^2 x^{2 n} \log \left (c \left (d+e x^n\right )^p\right )}{2 n}-\frac {d^2 g^2 p \log \left (d+e x^n\right )}{2 e^2 n}+\frac {d g^2 p x^n}{2 e n}-\frac {2 f g p x^n}{n}-\frac {g^2 p x^{2 n}}{4 n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((f + g*x^n)^2*Log[c*(d + e*x^n)^p])/x,x]

[Out]

(-2*f*g*p*x^n)/n + (d*g^2*p*x^n)/(2*e*n) - (g^2*p*x^(2*n))/(4*n) - (d^2*g^2*p*Log[d + e*x^n])/(2*e^2*n) + (g^2
*x^(2*n)*Log[c*(d + e*x^n)^p])/(2*n) + (2*f*g*(d + e*x^n)*Log[c*(d + e*x^n)^p])/(e*n) + (f^2*Log[-((e*x^n)/d)]
*Log[c*(d + e*x^n)^p])/n + (f^2*p*PolyLog[2, 1 + (e*x^n)/d])/n

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2441

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[Log[e*((f + g
*x)/(e*f - d*g))]*((a + b*Log[c*(d + e*x)^n])/g), x] - Dist[b*e*(n/g), Int[Log[(e*(f + g*x))/(e*f - d*g)]/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0]

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2463

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((h_.)*(x_))^(m_.)*((f_) + (g_.)*(x_)^(r_.))^(q
_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*Log[c*(d + e*x)^n])^p, (h*x)^m*(f + g*x^r)^q, x], x] /; FreeQ[{a,
 b, c, d, e, f, g, h, m, n, p, q, r}, x] && IntegerQ[m] && IntegerQ[q]

Rule 2525

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rubi steps

\begin {align*} \int \frac {\left (f+g x^n\right )^2 \log \left (c \left (d+e x^n\right )^p\right )}{x} \, dx &=\frac {\text {Subst}\left (\int \frac {(f+g x)^2 \log \left (c (d+e x)^p\right )}{x} \, dx,x,x^n\right )}{n}\\ &=\frac {\text {Subst}\left (\int \left (2 f g \log \left (c (d+e x)^p\right )+\frac {f^2 \log \left (c (d+e x)^p\right )}{x}+g^2 x \log \left (c (d+e x)^p\right )\right ) \, dx,x,x^n\right )}{n}\\ &=\frac {f^2 \text {Subst}\left (\int \frac {\log \left (c (d+e x)^p\right )}{x} \, dx,x,x^n\right )}{n}+\frac {(2 f g) \text {Subst}\left (\int \log \left (c (d+e x)^p\right ) \, dx,x,x^n\right )}{n}+\frac {g^2 \text {Subst}\left (\int x \log \left (c (d+e x)^p\right ) \, dx,x,x^n\right )}{n}\\ &=\frac {g^2 x^{2 n} \log \left (c \left (d+e x^n\right )^p\right )}{2 n}+\frac {f^2 \log \left (-\frac {e x^n}{d}\right ) \log \left (c \left (d+e x^n\right )^p\right )}{n}+\frac {(2 f g) \text {Subst}\left (\int \log \left (c x^p\right ) \, dx,x,d+e x^n\right )}{e n}-\frac {\left (e f^2 p\right ) \text {Subst}\left (\int \frac {\log \left (-\frac {e x}{d}\right )}{d+e x} \, dx,x,x^n\right )}{n}-\frac {\left (e g^2 p\right ) \text {Subst}\left (\int \frac {x^2}{d+e x} \, dx,x,x^n\right )}{2 n}\\ &=-\frac {2 f g p x^n}{n}+\frac {g^2 x^{2 n} \log \left (c \left (d+e x^n\right )^p\right )}{2 n}+\frac {2 f g \left (d+e x^n\right ) \log \left (c \left (d+e x^n\right )^p\right )}{e n}+\frac {f^2 \log \left (-\frac {e x^n}{d}\right ) \log \left (c \left (d+e x^n\right )^p\right )}{n}+\frac {f^2 p \text {Li}_2\left (1+\frac {e x^n}{d}\right )}{n}-\frac {\left (e g^2 p\right ) \text {Subst}\left (\int \left (-\frac {d}{e^2}+\frac {x}{e}+\frac {d^2}{e^2 (d+e x)}\right ) \, dx,x,x^n\right )}{2 n}\\ &=-\frac {2 f g p x^n}{n}+\frac {d g^2 p x^n}{2 e n}-\frac {g^2 p x^{2 n}}{4 n}-\frac {d^2 g^2 p \log \left (d+e x^n\right )}{2 e^2 n}+\frac {g^2 x^{2 n} \log \left (c \left (d+e x^n\right )^p\right )}{2 n}+\frac {2 f g \left (d+e x^n\right ) \log \left (c \left (d+e x^n\right )^p\right )}{e n}+\frac {f^2 \log \left (-\frac {e x^n}{d}\right ) \log \left (c \left (d+e x^n\right )^p\right )}{n}+\frac {f^2 p \text {Li}_2\left (1+\frac {e x^n}{d}\right )}{n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.14, size = 124, normalized size = 0.70 \begin {gather*} \frac {-e g p x^n \left (8 e f-2 d g+e g x^n\right )-2 d^2 g^2 p \log \left (d+e x^n\right )+2 e \left (4 d f g+e g x^n \left (4 f+g x^n\right )+2 e f^2 \log \left (-\frac {e x^n}{d}\right )\right ) \log \left (c \left (d+e x^n\right )^p\right )+4 e^2 f^2 p \text {Li}_2\left (1+\frac {e x^n}{d}\right )}{4 e^2 n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((f + g*x^n)^2*Log[c*(d + e*x^n)^p])/x,x]

[Out]

(-(e*g*p*x^n*(8*e*f - 2*d*g + e*g*x^n)) - 2*d^2*g^2*p*Log[d + e*x^n] + 2*e*(4*d*f*g + e*g*x^n*(4*f + g*x^n) +
2*e*f^2*Log[-((e*x^n)/d)])*Log[c*(d + e*x^n)^p] + 4*e^2*f^2*p*PolyLog[2, 1 + (e*x^n)/d])/(4*e^2*n)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.43, size = 665, normalized size = 3.78

method result size
risch \(\frac {\left (2 f^{2} \ln \left (x \right ) n +g^{2} x^{2 n}+4 f g \,x^{n}\right ) \ln \left (\left (d +e \,x^{n}\right )^{p}\right )}{2 n}+\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} x^{n} f g}{n}-\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \right ) x^{2 n} g^{2}}{4 n}+\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right ) x^{n} f g}{n}-\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{3} x^{2 n} g^{2}}{4 n}-\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \right ) x^{n} f g}{n}+\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} f^{2} \ln \left (x^{n}\right )}{2 n}-\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{3} f^{2} \ln \left (x^{n}\right )}{2 n}-\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{3} x^{n} f g}{n}-\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \right ) f^{2} \ln \left (x^{n}\right )}{2 n}+\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right ) f^{2} \ln \left (x^{n}\right )}{2 n}+\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right ) x^{2 n} g^{2}}{4 n}+\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} x^{2 n} g^{2}}{4 n}+\frac {\ln \left (c \right ) x^{2 n} g^{2}}{2 n}+\frac {2 \ln \left (c \right ) x^{n} f g}{n}+\frac {\ln \left (c \right ) f^{2} \ln \left (x^{n}\right )}{n}-\frac {g^{2} p \,x^{2 n}}{4 n}+\frac {d \,g^{2} p \,x^{n}}{2 e n}-\frac {d^{2} g^{2} p \ln \left (d +e \,x^{n}\right )}{2 e^{2} n}-\frac {p \,f^{2} \dilog \left (\frac {d +e \,x^{n}}{d}\right )}{n}-p \,f^{2} \ln \left (x \right ) \ln \left (\frac {d +e \,x^{n}}{d}\right )-\frac {2 f g p \,x^{n}}{n}+\frac {2 p f g d \ln \left (d +e \,x^{n}\right )}{e n}\) \(665\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f+g*x^n)^2*ln(c*(d+e*x^n)^p)/x,x,method=_RETURNVERBOSE)

[Out]

1/2*(2*f^2*ln(x)*n+g^2*(x^n)^2+4*f*g*x^n)/n*ln((d+e*x^n)^p)+I/n*Pi*csgn(I*(d+e*x^n)^p)*csgn(I*c*(d+e*x^n)^p)^2
*x^n*f*g+I/n*Pi*csgn(I*c*(d+e*x^n)^p)^2*csgn(I*c)*x^n*f*g+1/4*I/n*Pi*csgn(I*(d+e*x^n)^p)*csgn(I*c*(d+e*x^n)^p)
^2*(x^n)^2*g^2-I/n*Pi*csgn(I*(d+e*x^n)^p)*csgn(I*c*(d+e*x^n)^p)*csgn(I*c)*x^n*f*g+1/2*I/n*Pi*csgn(I*(d+e*x^n)^
p)*csgn(I*c*(d+e*x^n)^p)^2*f^2*ln(x^n)-1/2*I/n*Pi*csgn(I*c*(d+e*x^n)^p)^3*f^2*ln(x^n)-I/n*Pi*csgn(I*c*(d+e*x^n
)^p)^3*x^n*f*g+1/4*I/n*Pi*csgn(I*c*(d+e*x^n)^p)^2*csgn(I*c)*(x^n)^2*g^2-1/4*I/n*Pi*csgn(I*(d+e*x^n)^p)*csgn(I*
c*(d+e*x^n)^p)*csgn(I*c)*(x^n)^2*g^2-1/2*I/n*Pi*csgn(I*(d+e*x^n)^p)*csgn(I*c*(d+e*x^n)^p)*csgn(I*c)*f^2*ln(x^n
)+1/2*I/n*Pi*csgn(I*c*(d+e*x^n)^p)^2*csgn(I*c)*f^2*ln(x^n)-1/4*I/n*Pi*csgn(I*c*(d+e*x^n)^p)^3*(x^n)^2*g^2+1/2/
n*ln(c)*(x^n)^2*g^2+2/n*ln(c)*x^n*f*g+1/n*ln(c)*f^2*ln(x^n)-1/4*p/n*g^2*(x^n)^2+1/2*d*g^2*p*x^n/e/n-1/2*d^2*g^
2*p*ln(d+e*x^n)/e^2/n-p/n*f^2*dilog((d+e*x^n)/d)-p*f^2*ln(x)*ln((d+e*x^n)/d)-2*f*g*p*x^n/n+2*p/e/n*f*g*d*ln(d+
e*x^n)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g*x^n)^2*log(c*(d+e*x^n)^p)/x,x, algorithm="maxima")

[Out]

-1/4*(2*f^2*n^2*p*e^2*log(x)^2 - 2*(d*g^2*p*e - 4*(f*g*p - f*g*log(c))*e^2)*x^n + (g^2*p - 2*g^2*log(c))*e^(2*
n*log(x) + 2) - 2*(2*f^2*n*e^2*log(x) + g^2*e^(2*n*log(x) + 2) + 4*f*g*e^(n*log(x) + 2))*log((d + e^(n*log(x)
+ 1))^p) + 2*(d^2*g^2*n*p - 4*d*f*g*n*p*e - 2*f^2*n*e^2*log(c))*log(x))*e^(-2)/n + integrate(1/2*(2*d*f^2*n*p*
e^2*log(x) + d^3*g^2*p - 4*d^2*f*g*p*e)/(d*x*e^2 + x*e^(n*log(x) + 3)), x)

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 182, normalized size = 1.03 \begin {gather*} -\frac {{\left (4 \, f^{2} n p e^{2} \log \left (x\right ) \log \left (\frac {x^{n} e + d}{d}\right ) - 4 \, f^{2} n e^{2} \log \left (c\right ) \log \left (x\right ) + 4 \, f^{2} p {\rm Li}_2\left (-\frac {x^{n} e + d}{d} + 1\right ) e^{2} + {\left (g^{2} p e^{2} - 2 \, g^{2} e^{2} \log \left (c\right )\right )} x^{2 \, n} - 2 \, {\left (d g^{2} p e - 4 \, f g p e^{2} + 4 \, f g e^{2} \log \left (c\right )\right )} x^{n} - 2 \, {\left (2 \, f^{2} n p e^{2} \log \left (x\right ) - d^{2} g^{2} p + g^{2} p x^{2 \, n} e^{2} + 4 \, f g p x^{n} e^{2} + 4 \, d f g p e\right )} \log \left (x^{n} e + d\right )\right )} e^{\left (-2\right )}}{4 \, n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g*x^n)^2*log(c*(d+e*x^n)^p)/x,x, algorithm="fricas")

[Out]

-1/4*(4*f^2*n*p*e^2*log(x)*log((x^n*e + d)/d) - 4*f^2*n*e^2*log(c)*log(x) + 4*f^2*p*dilog(-(x^n*e + d)/d + 1)*
e^2 + (g^2*p*e^2 - 2*g^2*e^2*log(c))*x^(2*n) - 2*(d*g^2*p*e - 4*f*g*p*e^2 + 4*f*g*e^2*log(c))*x^n - 2*(2*f^2*n
*p*e^2*log(x) - d^2*g^2*p + g^2*p*x^(2*n)*e^2 + 4*f*g*p*x^n*e^2 + 4*d*f*g*p*e)*log(x^n*e + d))*e^(-2)/n

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (f + g x^{n}\right )^{2} \log {\left (c \left (d + e x^{n}\right )^{p} \right )}}{x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g*x**n)**2*ln(c*(d+e*x**n)**p)/x,x)

[Out]

Integral((f + g*x**n)**2*log(c*(d + e*x**n)**p)/x, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g*x^n)^2*log(c*(d+e*x^n)^p)/x,x, algorithm="giac")

[Out]

integrate((g*x^n + f)^2*log((x^n*e + d)^p*c)/x, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\ln \left (c\,{\left (d+e\,x^n\right )}^p\right )\,{\left (f+g\,x^n\right )}^2}{x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((log(c*(d + e*x^n)^p)*(f + g*x^n)^2)/x,x)

[Out]

int((log(c*(d + e*x^n)^p)*(f + g*x^n)^2)/x, x)

________________________________________________________________________________________